package com.wms.function.service.impl;

import java.util.List;
        import com.wms.common.utils.DateUtils;
import com.wms.function.domain.vo.TbWarehouseVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wms.function.mapper.TbWarehouseMapper;
import com.wms.function.domain.TbWarehouse;
import com.wms.function.service.ITbWarehouseService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.Arrays;

/**
 * 仓库设置Service业务层处理
 *
 * @author ruoyi
 * @date 2025-02-19
 */
@Service
public class TbWarehouseServiceImpl extends ServiceImpl<TbWarehouseMapper,TbWarehouse> implements ITbWarehouseService {
    @Autowired
    private TbWarehouseMapper tbWarehouseMapper;

    /**
     * 查询仓库设置
     *
     * @param id 仓库设置主键
     * @return 仓库设置
     */
    @Override
    public TbWarehouse selectTbWarehouseById(Long id) {
                return getById(id);
    }

    /**
     * 查询仓库设置列表
     *
     * @param tbWarehouse 仓库设置
     * @return 仓库设置
     */
    @Override
    public List<TbWarehouse> selectTbWarehouseList(TbWarehouse tbWarehouse) {
        return tbWarehouseMapper.selectTbWarehouseList(tbWarehouse);
    }

    /**
     * 新增仓库设置
     *
     * @param tbWarehouse 仓库设置
     * @return 结果
     */
    @Override
    public int insertTbWarehouse(TbWarehouse tbWarehouse) {
                                                                return save(tbWarehouse) ? 1 : 0;
    }

    /**
     * 修改仓库设置
     *
     * @param tbWarehouse 仓库设置
     * @return 结果
     */
    @Override
    public int updateTbWarehouse(TbWarehouse tbWarehouse) {
                                                        return updateById(tbWarehouse) ? 1 : 0;
    }

    /**
     * 批量删除仓库设置
     *
     * @param ids 需要删除的仓库设置主键
     * @return 结果
     */
    @Override
    public int deleteTbWarehouseByIds(Long[] ids) {
                return removeByIds(Arrays.asList(ids)) ? 1 : 0;
    }

    /**
     * 删除仓库设置信息
     *
     * @param id 仓库设置主键
     * @return 结果
     */
    @Override
    public int deleteTbWarehouseById(Long id) {
                return removeById(id) ? 1 : 0;
    }

    @Override
    public List<TbWarehouseVo> listAll() {
        return tbWarehouseMapper.listAll();
    }

}
